//
//  VISTAPictureCell.m
//  看杂志
//
//  Created by zcj on 15-12-14.
//  Copyright (c) 2015年 郑朝军. All rights reserved.
//

#import "VISTAPictureCell.h"
#import "Grouble.h"

@implementation VISTAPictureCell

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self configCell:frame];
    }
    return self;
}
- (void)configCell:(CGRect)frame
{
    self.backgroundColor = [UIColor blackColor];
    self.bg_imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 5, frame.size.width, frame.size.height)];
    self.icon_imageView = [[UIImageView alloc]initWithFrame:CGRectMake(6, 14, frame.size.width- 12, frame.size.width*0.75-7)];
    self.title_label = [[UILabel alloc]initWithFrame:CGRectMake(5, frame.size.width*0.75+8, frame.size.width-10, 20)];
    self.title_label.font = [UIFont systemFontOfSize:12];
    self.title_label.textColor = [UIColor colorWithRed:0.77 green:0 blue:0 alpha:1];
    self.title_label.textAlignment = NSTextAlignmentCenter;
    [self.contentView addSubview:self.bg_imageView];
    [self.contentView addSubview:self.icon_imageView];
    [self.contentView addSubview:self.title_label];
}
- (void)fillCellWithModel:(VISTAPictureViewModel *)model
{

    self.title_label.text = [NSString stringWithFormat:@"%@",model.title];
    [self.icon_imageView setImageWithURL:[NSURL URLWithString:model.icon] placeholderImage:[UIImage imageNamed:@"图片列缺省图"]];
}
@end
